<!DOCTYPE html>
<html lang="en"> 
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=0.5,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- 删除苹果默认的工具栏和菜单栏 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- 设置苹果工具栏颜色 -->
    <meta name="format-detection" content="telphone=no, email=no" />
    <!-- 忽略页面中的数字识别为电话，忽略email识别 -->
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
    <meta name="HandheldFriendly" content="true">
    <!-- 微软的老式浏览器 -->
    <meta name="MobileOptimized" content="320">
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
    <!-- UC强制全屏 -->
    <meta name="full-screen" content="yes">
    <!-- QQ强制全屏 -->
    <meta name="x5-fullscreen" content="true">
    <!-- UC应用模式 -->
    <meta name="browsermode" content="application">
    <!-- QQ应用模式 -->
    <meta name="x5-page-mode" content="app">
    <!-- windows phone 点击无高光 -->
    <meta name="msapplication-tap-highlight" content="no">
    <title>工单管理</title>
    <link rel="stylesheet" href="{{asset('css/reset.css')}}">
    <link rel="stylesheet" href="{{asset('css/main.css')}}">
    <link rel="stylesheet" href="{{asset('css/index.css')}}">
    <link rel="stylesheet" href="{{asset('css/LCalendar.css')}}">
    <link rel="stylesheet" href="{{asset('css/yd_rl.css')}}" />
</head>
<body>
    <!-- 公共头部 -->
    <div class="g2_head-bg">
        <!-- 返回上一层 -->
        <p class="g2_head_goback-bg fl">
            <a href="javascript:history.back(-1)">
                <img src="{{asset('images/xky_icon0-1.png')}}" class="g2_head_goback_icon fl" alt="">
                <span class="g2_head_goback_del fl">返回</span>
            </a>
        </p>
        <p class="ym-tit fl">成交单详情</p>
        <span class="g2_head_goback_del fr khxz_color">新增</span>
<!--         <span class="g2_head_goback_del fr khxz_color1">新增</span> -->
        <a href="{{url('deal/shoukuan')}}/{{$deal->id}}" class="g2_head_goback_del fr khxz_color2">新增</a>  <!-- 收款新增 -->
        <a href="{{url('deal/qingkuan')}}/{{$deal->id}}" class="g2_head_goback_del fr khxz_color3">新增</a>  <!-- 请款新增 -->
        <span class="g2_head_goback_del fr gdlb_sx">筛选</span>
        <div class="cl"></div>
    </div>
    <div class="g2_head-bg2"></div>

    <!-- 工单（成交单）详情 -->
    <div class="gdcjd-bg" id="cjdxq1">
        <form action="">
            <!-- 工单信息（成交单）详情 -->
            <p class="gdx2_tit">工单信息</p>
            <ul class="grzx_xq-bg">
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">旅游类型</p>
                    <p class="grzx_xgname_del fr">{{$order->order_didian}}</p>
    
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">旅游地点</p>
                    <p class="grzx_xgname_del fr">{{$order->order_didian2}}</p>
    
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">旅游线路</p>
                    <p class="grzx_xgname_del fr">{{$order->order_xianlu}}</p>
    
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">工单状态</p>
                    <p class="grzx_xgname_del gdyxd_zt fr">{{$order->order_statue}}</p>
    
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">录入人</p>
                    <p class="grzx_xgname_del fr">{{$order->staff_id}}</p>
    
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">工单备注</p>
                    <p class="grzx_xgname_del fr">{{$order->order_beizhu}}</p>
    
                    <div class="cl"></div>
                </li>
            </ul>
            <!-- 客户信息（成交单）详情 -->
            <p class="gdx2_tit">客户信息</p>
            <ul class="grzx_xq-bg">
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">客户姓名</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">{{$customer->customer_name}}</p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">客户电话</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">{{$customer->customer_phone}}</p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">电子邮箱</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">{{$customer->customer_email}}</p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">身份证号</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">{{$customer->customer_sfz}}</p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">单位</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">{{$customer->customer_danwei}}</p>
                    <div class="cl"></div>
                </li>
            </ul>
            <!-- 成交单信息   详情 -->
            <p class="gdx2_tit">成交单信息</p>
            <ul class="grzx_xq-bg">
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">合同类型</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                         <input type="text" placeholder="合同类型" class="grzx_xgsjhm" value="{{$deal->deal_hetongtype}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">合同编号</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                         <input type="text" placeholder="合同编号" class="grzx_xgsjhm" value="{{$deal->deal_hetong}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">旅游人数</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <span class="cjd_lynumadd fr">+</span>
                        <input type="text" class="cjd_lynums fr" value="{{$deal->deal_num}}">
                        <span class="cjd_lynumj2 fr">-</span>
                        <div class="cl"></div>
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">应收款</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                         <input type="text" placeholder="应收款" class="grzx_xgsjhm" value="{{$deal->deal_yshoukuan}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">应付款</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" placeholder="应付款" class="grzx_xgsjhm" value="{{$deal->deal_ydakuan}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">预估毛利</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" placeholder="预估毛利" class="grzx_xgsjhm" value="{{$deal->deal_yglirun}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">实收款</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" placeholder="实收款" class="grzx_xgsjhm" value="{{$deal->deal_sshoukuan}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">实付款</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" placeholder="实付款" class="grzx_xgsjhm" value="{{$deal->deal_sdakuan}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">实际毛利</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" placeholder="请输入实际毛利" class="grzx_xgsjhm" value="{{$deal->deal_lirun}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">操作类别</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" placeholder="操作类别" class="grzx_xgsjhm" value="{{$deal->deal_leibie}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">供应商名称</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" placeholder="供应商名称" class="grzx_xgsjhm" value="{{$deal->deal_gongyingshang}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list" style="position:relative;">
                    <p class="grzx_xgname fl">出发时间</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                         <input type="text" placeholder="出发时间" class="grzx_xgsjhm" value="{{$deal->deal_ftdate}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">员工姓名</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" placeholder="请填写员工姓名" class="grzx_xgsjhm" value="{{$deal->deal_yuangong}}">
                    </p>
                    <div class="cl"></div>
                </li>
            </ul>
            <div style="width:100%;height:20vw;"></div>
            <a href="{{url('deal/huifang')}}/{{$deal->id}}">
                <input type="button" class="cjd_hfbtn" value="回访">
            </a>
            <div class="cjd_gd-bg">
                ● ● ●
                <p class="cjd_gdanbg">
                    <input type="button" class="ckd_ykxq-btn" value="游客详情">
                    <input type="button" class="ckd_skxq-btn" value="收款详情">
                    <input type="button" class="ckd_qkxq-btn" value="请款详情">
                </p>
            </div>
            @if($deal->deal_jiesuanstatue==1)
            <input type="button" id="hesuan" class="cjd_sqhsbtn" value="申请核算">
            @elseif($deal->deal_jiesuanstatue==2)
            <input type="button" class="cjd_sqhsbtn" value="正在核算中">
            @else
            <input type="button" class="cjd_sqhsbtn" value="已核算">
            @endif
        </form>
    </div>

    <!-- 工单（成交单）游客详情 -->
    <div class="cjd_ykxq-bg" id="cjdxq2">
        @foreach($youke as $vo)
        <div class="cjd_ykxqx2-bg">
            <p class="cjd_ykxq_username fl">{{$vo->tourist_name}}</p>
            <span class="cjd_ykxq_iphone fl">{{$vo->tourist_phone}}</span>
            <p class="cjd_ykxq_sfzh fl">{{$vo->tourist_number}}</p>
            <span class="cjd_ykxq_sex fr">{{$vo->tourist_sex}}</span>
            <div class="cl"></div>
        </div>
        @endforeach
    </div>

    <!-- 工单（成交单）收款记录 -->
    <div class="cjd_skjl-bg" id="cjdxq3">
        @foreach($shoukuan as $vo)
        <div class="cjd_skjlx2-bg">
            <p class="cjd_ykxq_khname fl">
                <span>收款人 : </span>
                <span>{{$vo->receive_zhanghu}}</span>
            </p>
            <span class="cjd_ykxq_jenum fr">￥{{$vo->receive_sshoukuan}}</span>
            <p class="cjd_ykxq_sfzh fl">申请人：{{$vo->receive_yuangong}}</p>
            <span class="cjd_ykxq_sp fr">
                @if($vo->receive_statue==1)
                    审批中
                @elseif($vo->receive_statue==2)
                    通过
                @else
                    驳回
                @endif
            </span>
            <div class="cl"></div>
            <ul class="cjd_skfs_listbg">
                <li class="cjd_skfs_list">
                    <p class="cjd_skfs_listit fl">收款方式</p>
                    <p class="cjd_skfs_listdel fr">{{$vo->receive_fangshi}}</p>
                    <div class="cl"></div>
                </li>
                <li class="cjd_skfs_list">
                    <p class="cjd_skfs_listit fl">收款账号</p>
                    <p class="cjd_skfs_listdel fr">{{$vo->receive_zhanghao}}</p>
                    <div class="cl"></div>
                </li>
                <li class="cjd_skfs_list">
                    <p class="cjd_skfs_listit fl">备注信息</p>
                    <p class="cjd_skfs_listdel fr">{{$vo->receive_beizhu}}</p>
                    <div class="cl"></div>
                </li>
            </ul>
        </div>
        @endforeach
    </div>

    <!-- 工单（成交单）请款记录 -->
    <div class="cjd_qkjl-bg" id="cjdxq4">
        @foreach($funds as $vo)
        <div class="cjd_qkjlx2-bg">
            <p class="cjd_ykxq_khname fl">
                {{$vo->funds_typename}}
            </p>
            <span class="cjd_ykxq_jenum fr">￥{{$vo->funds_money}}</span>
            <p class="cjd_ykxq_sfzh fl">
                <span>请款人 : </span>
                <span>{{$vo->funds_name}}</span>
            </p>
            <span class="cjd_ykxq_sp fr">
                @if($vo->funds_statue==1)
                    审批中
                @elseif($vo->funds_statue==2)
                    通过
                @else
                    驳回
                @endif
            </span>
            <div class="cl"></div>
            <ul class="cjd_skfs_listbg">
                <li class="cjd_skfs_list">
                    <p class="cjd_skfs_listit fl">请款方式</p>
                    <p class="cjd_skfs_listdel fr">{{$vo->funds_type}}</p>
                    <div class="cl"></div>
                </li>
                <li class="cjd_skfs_list">
                    <p class="cjd_skfs_listit fl">请款账号</p>
                    <p class="cjd_skfs_listdel fr">{{$vo->funds_zhanghu}}</p>
                    <div class="cl"></div>
                </li>
                <li class="cjd_skfs_list">
                    <p class="cjd_skfs_listit fl">备注信息</p>
                    <p class="cjd_skfs_listdel fr">{{$vo->funds_beizhu}}</p>
                    <div class="cl"></div>
                </li>
            </ul>
        </div>
        @endforeach
    </div>
    <!-- 遮罩 -->
    <!-- loading 小圆圈 -->
    <div class="z2_loading-bg" style="width:100%;height:100%;background:rgba(255,255,255,0.6);position:fixed;;left:0;top:0;">
        <img src="{{asset('images/loading1.gif')}}" style="width:10%;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;" alt="">
    </div>
    <!-- loadning对号 -->
    <div class="duihao" style="width:100%;height:100%;position:fixed;;left:0;top:0;display:none;">
        <img src="{{asset('images/duihao.png')}}" style="width:10%;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;" alt="">
    </div>
    <script src="{{asset('js/jquery.min.js')}}"></script>
    <script src="{{asset('js/fastclick.min.js')}}"></script>
</body>
    <script src="{{asset('js/index.js')}}" type="text/javascript" charset="utf-8"></script>
    <script>
        $(function () {
            FastClick.attach(document.body);
        });
        $(function () {
            $("#hesuan").click(function(){
                var id={{$deal->id}};
                $.ajax({
                    url:"{{url('shenqinghesuan')}}",
                    type:'get', //GET
                    async:false,    //或false,是否异步
                    data:{'id':id},
                    dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
                    success:function(data){ 
                        if(data=='false'){
                            $("#tishi").html('申请失败');
                            $("#tishi").stop(true, true).fadeIn('fast');
                            $("#tishi").fadeOut(1500);
                        }else{
                            window.location.reload();
                        }
                    }, 
                })
            });
        });
        window.onload = function (event) {
            location.hash = 'cjdxq1';
            $("#cjdxq1").show();
            $("#cjdxq2").hide();
            $("#cjdxq3").hide();
            $("#cjdxq4").hide();
            $('.khxz_color2').hide();
            $('.khxz_color3').hide();
            $(".z2_loading-bg").hide();
        }

    $(window).on('hashchange', function (e) {
        var id = location.hash.substr(1);
        $("#" + id).show()

        if (id == "cjdxq1") {
            $("#cjdxq1").show();
            $("#cjdxq2").hide();
            $("#cjdxq3").hide();
            $("#cjdxq4").hide();
            $('.khxz_color2').hide();
            $('.khxz_color3').hide();
            $('.ym-tit').html('成交单详情');
        } else if (id == "cjdxq2") {
            $("#cjdxq1").hide();
            $("#cjdxq2").show();
            $("#cjdxq3").hide();
            $("#cjdxq4").hide();
            $('.khxz_color2').hide();
            $('.khxz_color3').hide();
            $('.ym-tit').html('成交单游客详情');
        } else if (id == "cjdxq3") {
            $("#cjdxq1").hide();
            $("#cjdxq2").hide();
            $("#cjdxq3").show();
            $("#cjdxq4").hide();
            $('.khxz_color2').show();
            $('.khxz_color3').hide();
            $('.ym-tit').html('成交单收款记录');
        } else if (id == "cjdxq4") {
            $("#cjdxq1").hide();
            $("#cjdxq2").hide();
            $("#cjdxq3").hide();
            $("#cjdxq4").show();
            $('.khxz_color2').hide();
            $('.khxz_color3').show();
            $('.ym-tit').html('成交单请款记录');
        }
    })
    // 成交单  游客详情
    $('.ckd_ykxq-btn').click(function () {
        location.hash = 'cjdxq2';
        $("#cjdxq1").hide();
        $("#cjdxq2").show();
        $("#cjdxq3").hide();
        $("#cjdxq4").hide();
        $('.khxz_color2').hide();
        $('.khxz_color3').hide();
        $('.ym-tit').html('成交单游客详情');
    })
    // 成交单  收款记录
    $('.ckd_skxq-btn').click(function () {
        location.hash = 'cjdxq3';
        $("#cjdxq1").hide();
        $("#cjdxq2").hide();
        $("#cjdxq3").show();
        $("#cjdxq4").hide();
        $('.khxz_color2').show();
        $('.khxz_color3').hide();
        $('.ym-tit').html('成交单收款记录');
    })
    // 成交单  请款记录
    $('.ckd_qkxq-btn').click(function () {
        location.hash = 'cjdxq4';
        $("#cjdxq1").hide();
        $("#cjdxq2").hide();
        $("#cjdxq3").hide();
        $("#cjdxq4").show();
        $('.khxz_color2').hide();
        $('.khxz_color3').show();
        $('.ym-tit').html('成交单请款记录');
    })
    </script>
</html>